using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NUnit.Framework;

namespace QuickBencher.Test
{
    [TestFixture]
    public class ActionExecutionTests
    {
        [Test]
        public void Should_run_action_sent_to_measure()
        {
            bool action_ran = false;
            Benchmark.Measure(() => action_ran = true);
            Assert.That(action_ran);
        }

        [Test]
        public void Should_run_action_sent_to_report()
        {
            bool action_ran = false;
            Benchmark.Bm(bm 
                => bm.Report(() => action_ran = true));
            Assert.That(action_ran);
        }

        [Test]
        public void Should_run_action_sent_to_report_twice()
        {
            int run_counter = 0;
            Benchmark.Bmbm(bm 
                => bm.Report(() => run_counter++));
            Assert.That(run_counter == 2);
        }
    }
}
